package cz.proks.easyhelpdesk.gwt.ui.composite;

import java.util.Collection;

import com.google.gwt.event.shared.HandlerRegistration;

import cz.proks.easyhelpdesk.api.model.Filter;
import cz.proks.easyhelpdesk.api.model.Helpdesk;
import cz.proks.easyhelpdesk.gwt.event.FilterChangeEvent;
import cz.proks.easyhelpdesk.gwt.event.HelpdeskChangeEvent;
import cz.proks.easyhelpdesk.gwt.event.RightArrowClickEvent.Handler;
import cz.proks.easyhelpdesk.gwt.ui.base.RestrictedHelpdeskView;
import cz.proks.easyhelpdesk.gwt.ui.layout.IsMainLayoutPanel;

public abstract class RestrictedHelpdeskComposite extends RestrictedComposite implements RestrictedHelpdeskView {

    @Override
    protected abstract IsMainLayoutPanel.ForHelpdesk getRootPanel();
    
    @Override
    public Collection<Filter> getFilters() {
        return getRootPanel().getFilters();
    }

    @Override
    public void setHelpdesks(Collection<Helpdesk> helpdesks) {
        getRootPanel().setHelpdesks(helpdesks);        
    }

    @Override
    public void setSelectedHelpdesk(Helpdesk helpdesk) {
        getRootPanel().setSelectedHelpdesk(helpdesk);
    }

    @Override
    public HandlerRegistration addHelpdeskChangeHandler(HelpdeskChangeEvent.Handler handler) {
        return getRootPanel().addHelpdeskChangeHandler(handler);
    }

    @Override
    public HandlerRegistration addFilterChangeHandler(FilterChangeEvent.Handler handler) {
        return getRootPanel().addFilterChangeHandler(handler);
    }              
    
    @Override
    public void showSettingsButton(boolean showButton) {
        getRootPanel().showSettingsButton(showButton);
    }

    @Override
    public void setCreateTicketButtonTargetToken(String targetToken) {
        getRootPanel().setCreateTicketButtonTargetToken(targetToken);
    }

    @Override
    public void setSettingsButtonTargetToken(String targetToken) {
        getRootPanel().setSettingsButtonTargetToken(targetToken);
    }

    @Override
    public HandlerRegistration addRightArrowClickHandler(Handler handler) {
        return getRootPanel().addRightArrowClickHandler(handler);        
    }

    @Override
    public HandlerRegistration addLeftArrowClickHandler(cz.proks.easyhelpdesk.gwt.event.LeftArrowClickEvent.Handler handler) {
        return getRootPanel().addLeftArrowClickHandler(handler);
    }

    @Override
    public void setStartCount(Long startCount) {
        getRootPanel().setStartCount(startCount);
    }

    @Override
    public void setEndCount(Long endCount) {
        getRootPanel().setEndCount(endCount);
    }

    @Override
    public void setComplexCount(Long complexCount) {
        getRootPanel().setComplexCount(complexCount);
    }
    
    @Override
    public void onErase() {
        getRootPanel().onErase();
    }
}
